#ifndef TESTWIDGET_H
#define TESTWIDGET_H

#include <QWidget>
#include <QTreeWidget>
#include <QHeaderView>  // 隐藏树的head需要的头文件
#include <QTreeWidgetItem>
#include <QContextMenuEvent>

#include "SmoothScroll.h"
#include "ScrollTree.h"

namespace Ui {
class TestWidget;
}

#include <QDebug>
#define qout qDebug()  << "[" << __FILE__ << ":" << __LINE__ << "]" <<

class TestWidget : public QWidget
{
    Q_OBJECT

public:
    explicit TestWidget(QWidget *parent = 0);
    ~TestWidget();




private slots:
    void slotItemClicked(QTreeWidgetItem *item, int column);        // 单击事件
    void slotItemDoubleClicked(QTreeWidgetItem *item, int column);  // 双击事件
    void slotShowMenu(QPoint point);                                // 右键菜单

    void slotMouseSuspension(QModelIndex index);

    void slotClicked();

private :
    // 树初始化
    inline void treeInit();

    // 输出节点信息
    void printMsg(QPoint point);

private:
    Ui::TestWidget *ui;

    // SmoothScroll *m_tree = nullptr;
    QTreeWidget *m_tree = nullptr;
};

#endif // TESTWIDGET_H
